package com.tes.tabel;

import android.database.sqlite.SQLiteDatabase;
import android.util.Log;

public class TabelHighScore {
	public static final String NAMA_TABEL = "tb_highscore";

	public static final String KOLOM_ID = "id_level";
	public static final String KOLOM_SCORE = "score";

	private static final String CREATE_TABLE = "CREATE TABLE " 
			+ NAMA_TABEL
			+ "(" 
			+ KOLOM_ID + " INTEGER PRIMARY KEY, " 
			+ KOLOM_SCORE + " INTEGER"
			+ ");";
	
	public static void onCreate(SQLiteDatabase database) {
		database.execSQL(CREATE_TABLE);
	}

	public static void onUpgrade(SQLiteDatabase database, int oldVersion,
			int newVersion) {
		Log.w(TabelHighScore.class.getName(), "Upgrading database from version "
				+ oldVersion + " to " + newVersion
				+ ", which will destroy all old data");
		database.execSQL("DROP TABLE IF EXISTS " + NAMA_TABEL);
		onCreate(database);
	}
}
